package org.csu.tank.controller;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import org.csu.tank.bean.SucceedIntegration;

public class SucceedController {

    // 罗马符号表
    private static final String[] ROME = new String[]{
            "〇","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ"
    };

    @FXML
    private Label level1TankNumLeft;

    @FXML
    private ImageView line;

    @FXML
    private Label TotalLeft;

    @FXML
    private Label TotalRight;

    @FXML
    private Label starLeft;

    @FXML
    private Label starRight;

    @FXML
    private Label TotalLevel4Left;

    @FXML
    private Label level4TankNumLeft;

    @FXML
    private Label TotalLevel3Right;

    @FXML
    private Label playerId;

    @FXML
    private Label level4TankNumRight;

    @FXML
    private Label TotalLevel4Right;

    @FXML
    private Label TotalLevel1Right;

    @FXML
    private Label level3TankNumRight;

    @FXML
    private Label rightPlawerScore;

    @FXML
    private Label hiScore;

    @FXML
    private Label TotalLevel3Left;

    @FXML
    private Label level2TankNumRight;

    @FXML
    private Label level;

    @FXML
    private Label TotalLevel2Left;

    @FXML
    private Label level1TankNumRight;

    @FXML
    private Label level3TankNumLeft;

    @FXML
    private Label level2TankNumLeft;

    @FXML
    private Label playerScore;

    @FXML
    private Label TotalLevel2Right;

    @FXML
    private Label TotalLevel1Left;

    public void initialize(SucceedIntegration succeedIntegration) {
        if (succeedIntegration.isDoubleMode()) {// 当前游戏是双人模式
            return;
        } else { // 当前游戏不是双人模式
            this.hiScore.setText("20000");  // 这里先默认最高分20000
            this.level.setText(succeedIntegration.getLevel());      // 当前游戏关卡
            this.level1TankNumLeft.setText(succeedIntegration.getLevel1Tank().toString());
            this.level2TankNumLeft.setText(succeedIntegration.getLevel2Tank().toString());
            this.level3TankNumLeft.setText(succeedIntegration.getLevel3Tank().toString());
            this.level4TankNumLeft.setText(succeedIntegration.getLevel4Tank().toString());
            this.TotalLevel1Left.setText(succeedIntegration.getLevel1Tank()*100+"");
            this.TotalLevel2Left.setText(succeedIntegration.getLevel2Tank()*200+"");
            this.TotalLevel3Left.setText(succeedIntegration.getLevel3Tank()*300+"");
            this.TotalLevel4Left.setText(succeedIntegration.getLevel4Tank()*400+"");
            this.TotalLeft.setText(succeedIntegration.getLevel1Tank()+succeedIntegration.getLevel2Tank()+succeedIntegration.getLevel3Tank()+succeedIntegration.getLevel4Tank()+"");
            this.starLeft.setText(succeedIntegration.getStarsNum()*1000+"");
            this.playerScore.setText(succeedIntegration.getLevel1Tank() * 100 + succeedIntegration.getLevel2Tank() * 200 + succeedIntegration.getLevel3Tank() * 300 + succeedIntegration.getLevel4Tank() * 400 + succeedIntegration.getStarsNum() * 1000+"");
            this.playerId.setText(this.ROME[succeedIntegration.getPlayerId()]);
            // 设置右边全部不可见
        }
    }

}
